<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .search{
            width: 100px;
            height: 50px;
            margin: auto;
        }
    </style>
</head>
<body>
    <div class="search">
        <div class="con"></div>
        <label>
            快递单号：
            <input type="text" placeholder="请输入您的快递单号" class="num">
        </label>
    </div>
    <script>
        const con=document.querySelector('.con');
        const numInput=document.querySelector('.num');
        numInput.addEventListener('keyup',function(){
            if(this.value==''){
                con.style.display='none';
            }else{
                con.style.display='block';
                con.innerText=this.value;
            }
        });
        // numInpt.addEventListener('blur',function(){
        //     con.style.display='none';
        // });
        // numInpt.addEventListener('focus',function(){
        //     if(this.value!==''){
        //         con.style.display='block';
        //     }
        // });
    </script>
</body>
</html>